﻿@model LawProject.Models.ViewTTC

@{
    ViewBag.Title = "ChiTietTTC";
    Layout = "~/Views/Shared/AdminLayout.cshtml";
}
 <script src="@Url.Content("~/Content/ckeditor/ckeditor.js")" type="text/javascript"></script>
   <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.js")" type="text/javascript"></script>

    <style>
    .textboxedit
    {
        width:540px;
    }
    .divtextbox
    {
        margin:5px;
    }
</style>
<h2>Thông tin chung</h2>
<h3>Tiếng việt</h3>
@using (Html.BeginForm("ThongTinUpdate", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
            @Html.ValidationSummary(true)

             <div id="hiddenMaTT">
            @Html.HiddenFor(model => model.MaTT)
            </div>
    
             <div id="hiddenTenTTVN">
            @Html.TextBoxFor(model => model.TenTT, new { @class = "textboxedit" })
            </div>
    
             <div class="divtextbox" style="width:540px;">
                <textarea class="ckeditor" id="editor1" rows="10" style="width:540px; height:300px; overflow-x:hidden;"></textarea>
            </div>
    
             <div id="hiddenNoiDungVN">
            @Html.HiddenFor(model => model.NoiDung)
            </div>
    <h3>Tiếng Anh</h3>
           <div id="hiddenTenTTEN" class="divtextbox" style="width:540px;">
            @Html.TextBoxFor(model => model.TenEN, new { @class = "textboxedit" })
            </div>
             
            <div class="divtextbox" style="width:540px;">
                <textarea class="ckeditor" id="editor2" rows="10" style="width:540px; height:300px; overflow-x:hidden;"></textarea>
            </div>  
    
            <div id="hiddenNoiDungEN">
            @Html.HiddenFor(model => model.NoiDungEN)
            </div>
    
                        
            <div style="position:relative; text-align:center; width:540px;">
            <input id="submit" type="submit" value="Lưu thông tin"/>
            </div>
        
}
<script type="text/javascript">
    $(document).ready(function () {
        $("#submit").click(function () {
            var value1 = CKEDITOR.instances['editor1'].getData();
            var value2 = CKEDITOR.instances['editor2'].getData();
            $("#hiddenNoiDungVN > input").val(value1);
            $("#hiddenNoiDungEN > input").val(value2);

        })
    })
    $(window).load(function () {
        CKEDITOR.instances['editor1'].setData($("#hiddenNoiDungVN > input").val());
        CKEDITOR.instances['editor2'].setData($("#hiddenNoiDungEN > input").val());
    });
         
        
</script>

